<?php
    
  $aux = explode ( '|', isset($_GET['id']) ? $_GET['id'] : '' );
  $ImmigrationsdetailsUid = str_replace ( '"', '', $aux[0] );
  
  require_once ( PATH_PLUGINS . 'hr' . PATH_SEP . 'class.hr.php');
  $pluginObj = new hrClass ();

  require_once ( "classes/model/HrImmigrationsDetails.php" );
  //if exists the row in the database propel will update it, otherwise will insert.
  $tr = HrImmigrationsDetailsPeer::retrieveByPK( $ImmigrationsdetailsUid  );
  
  if ( ( is_object ( $tr ) &&  get_class ($tr) == 'HrImmigrationsDetails' ) ) { 
     $fields['IMMIGRATIONSDETAILS_UID'] = $tr->getImmigrationsdetailsUid();
     $fields['EMPLOYEE_ID'] = $tr->getEmployeeId();
     $fields['PASSPORT'] = $tr->getPassport();
     $fields['PASSPORTNUMBER'] = $tr->getPassportnumber();
     $fields['TYPEVISA_ID'] = $tr->getTypevisaId();
     $fields['VISANUMBER'] = $tr->getVisanumber();
  }
  else
    $fields = array();  
  
  $G_MAIN_MENU = 'processmaker';
  $G_SUB_MENU = 'hr/menuhrEmployee';
  $G_ID_MENU_SELECTED = 'ID_HR_EMP';
  $G_ID_SUB_MENU_SELECTED = 'ID_HR_IMMIGRATIONS_DETAILS';


  $G_PUBLISH = new Publisher;
  $G_PUBLISH->AddContent('xmlform', 'xmlform', 'hr/hrImmigrationsDetailsEdit', '', $fields, 'hrImmigrationsDetailsSave' );
  G::RenderPage('publish', 'blank');   
?>